package nacc

import org.apache.commons.lang.builder.EqualsBuilder
import org.apache.commons.lang.builder.HashCodeBuilder
/**
 * @author Leonardo
 * @author Ednaldo
 */


class Contribuinte {
	
	String nome
	String tipo
	String formaTratamento
	Date dataNascimento
	String telResidencial
	String celular
	String telComercial
	String profissao
	String cpf
	Operador operador
	String observacoes
	String endereco
	String numero
	String bairro
	String cidade
	String cep
	String uf
	String complemento
	String pontoDeReferencia

    static constraints = {
    
		nome(nullable:false , blank:false)
		tipo(nullable:true , blank:true)
		formaTratamento(nullable:true , blank:true)
		dataNascimento(nullable:false , blank:false)
		telResidencial(nullable:true , blank:true,matches:"^(\\(\\d{2,3}\\)|\\d{2,3})([-\\s]?\\d{4}){2}")
		celular(nullable:true , blank:true,matches:"^(\\(\\d{2,3}\\)|\\d{2,3})([-\\s]?\\d{4}){2}")
		telComercial(nullable:true , blank:true,matches:"^(\\(\\d{2,3}\\)|\\d{2,3})([-\\s]?\\d{4}){2}")
		profissao(nullable:true , blank:true)
		cpf(nullable:false , blank:false, cpf:[formatted:true])
		endereco(nullable:true , blank:true)
		numero(nullable:true , blank:true)
		bairro(nullable:true , blank:true)
		cidade(nullable:true , blank:true)
		cep(nullable:false , blank:false)
		uf(nullable:true , blank:true)
		complemento(nullable:false , blank:false,size: 0..250)
		pontoDeReferencia(nullable:true , blank:true, size: 0..250)
		operador(nullable:false , blank:false)
	}
	
	@Override
	public String toString() {
		nome
	}
}
